import {FormBase, ControlType} from './form-base';

export class FormSelect extends FormBase<string> {
    controlType: ControlType = 'select';
    value: string;
    options: { label: string, value: string }[] = [];
    childKey = '';
    fetchData: {
        path: string;
        targetKey: string;
        targetValue: string;
    };
    multiple = false;
    maxMultipleCount = 99;
    init = false;

    constructor(options: {} = {}) {
        super(options);
        this.value = options['value'] || null;
        this.options = options['options'] || [];
        this.multiple = options['multiple'] || false;
        this.childKey = options['childKey'] || '';
        this.fetchData = options['fetchData'] || {};
        this.maxMultipleCount = options['maxMultipleCount'] || 99;
        this.init = options['init'] || false;

    }
}
